﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sto3a00
    {
		private string _stolistid;
		private string _docno;
        private DateTime? _ordate;
		private string _prolistid;
        private int? _providecode;
		private string _providename;
		private string _tuser;
		private string _tel;
		private string _fax;
        private int? _predate;
        private DateTime? _bsendate;
        private int? _stocode;
		private string _nvarchar20;
		private string _stuser;
		private string _stel;
		private string _sfax;
        private int? _status;
		private double _ordamt;
		private double _accamt;
		private double _gainamt;
		private double _gainpct;
		private double _dutyamt;
        private int? _audstatus;
		private double _agio1;
		private double _agio2;
		private double _agio3;
		private string _usercode;
		private string _listid;
		
        /// <summary>
        /// 仓库标识
        /// </summary>
		public string Stolistid
		{
			get { return _stolistid;	 }
			set { _stolistid=value;	}
		}
        /// <summary>
        /// 订单标识
        /// </summary>
		public string Docno
		{
			get { return _docno;	 }
			set { _docno=value;	}
		}
        /// <summary>
        /// 订货日期
        /// </summary>
		public DateTime? Ordate
		{
			get { return _ordate;	 }
			set { _ordate=value;	}
		}
        /// <summary>
        /// 供应商标识
        /// </summary>
		public string Prolistid
		{
			get { return _prolistid;	 }
			set { _prolistid=value;	}
		}
        /// <summary>
        /// 供应商
        /// </summary>
		public int? Providecode
		{
			get { return _providecode;	 }
			set { _providecode=value;	}
		}
        /// <summary>
        /// 供应商名称
        /// </summary>
		public string Providename
		{
			get { return _providename;	 }
			set { _providename=value;	}
		}
        /// <summary>
        /// 联系人
        /// </summary>
		public string Tuser
		{
			get { return _tuser;	 }
			set { _tuser=value;	}
		}
        /// <summary>
        /// 电话
        /// </summary>
		public string Tel
		{
			get { return _tel;	 }
			set { _tel=value;	}
		}
        /// <summary>
        /// 传真
        /// </summary>
		public string Fax
		{
			get { return _fax;	 }
			set { _fax=value;	}
		}
        /// <summary>
        /// 准备天数
        /// </summary>
		public int? Predate
		{
			get { return _predate;	 }
			set { _predate=value;	}
		}
        /// <summary>
        /// 应送货日期
        /// </summary>
		public DateTime? Bsendate
		{
			get { return _bsendate;	 }
			set { _bsendate=value;	}
		}
        /// <summary>
        /// 仓库代码
        /// </summary>
		public int? Stocode
		{
			get { return _stocode;	 }
			set { _stocode=value;	}
		}
        /// <summary>
        /// 仓库地址
        /// </summary>
		public string Nvarchar20
		{
			get { return _nvarchar20;	 }
			set { _nvarchar20=value;	}
		}
        /// <summary>
        /// 仓库联系人
        /// </summary>
		public string Stuser
		{
			get { return _stuser;	 }
			set { _stuser=value;	}
		}
        /// <summary>
        /// 仓库电话
        /// </summary>
		public string Stel
		{
			get { return _stel;	 }
			set { _stel=value;	}
		}
        /// <summary>
        /// 仓库传真
        /// </summary>
		public string Sfax
		{
			get { return _sfax;	 }
			set { _sfax=value;	}
		}
        /// <summary>
        /// 订单状态
        /// </summary>
		public int? Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
        /// <summary>
        /// 订单总额
        /// </summary>
		public double Ordamt
		{
			get { return _ordamt;	 }
			set { _ordamt=value;	}
		}
        /// <summary>
        /// 收货总额
        /// </summary>
		public double Accamt
		{
			get { return _accamt;	 }
			set { _accamt=value;	}
		}
        /// <summary>
        /// 毛利总额
        /// </summary>
		public double Gainamt
		{
			get { return _gainamt;	 }
			set { _gainamt=value;	}
		}
        /// <summary>
        /// 毛利率
        /// </summary>
		public double Gainpct
		{
			get { return _gainpct;	 }
			set { _gainpct=value;	}
		}
        /// <summary>
        /// 税额
        /// </summary>
		public double Dutyamt
		{
			get { return _dutyamt;	 }
			set { _dutyamt=value;	}
		}
        /// <summary>
        /// 订单审核状态
        /// </summary>
		public int? Audstatus
		{
			get { return _audstatus;	 }
			set { _audstatus=value;	}
		}
        /// <summary>
        /// 折扣1
        /// </summary>
		public double Agio1
		{
			get { return _agio1;	 }
			set { _agio1=value;	}
		}
        /// <summary>
        /// 折扣2
        /// </summary>
		public double Agio2
		{
			get { return _agio2;	 }
			set { _agio2=value;	}
		}
        /// <summary>
        /// 折扣3
        /// </summary>
		public double Agio3
		{
			get { return _agio3;	 }
			set { _agio3=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Sto3a00> GetSto3a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sto3a00> list = new List<Sto3a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sto3a00 model = GetSto3a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sto3a00 GetSto3a00ByDataRow(DataRow dr)
		{
			Sto3a00 model = new Sto3a00(); //实例化Sto3a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("stolistid")&&!(dr["stolistid"] is System.DBNull))  
				model.Stolistid = ( string)dr["stolistid"];
			if (dcc.Contains("docno")&&!(dr["docno"] is System.DBNull))  
				model.Docno = ( string)dr["docno"];
			if (dcc.Contains("ordate")&&!(dr["ordate"] is System.DBNull))  
				model.Ordate = ( DateTime)dr["ordate"];
			if (dcc.Contains("prolistid")&&!(dr["prolistid"] is System.DBNull))  
				model.Prolistid = ( string)dr["prolistid"];
			if (dcc.Contains("providecode")&&!(dr["providecode"] is System.DBNull))  
				model.Providecode = ( int)dr["providecode"];
			if (dcc.Contains("providename")&&!(dr["providename"] is System.DBNull))  
				model.Providename = ( string)dr["providename"];
			if (dcc.Contains("tuser")&&!(dr["tuser"] is System.DBNull))  
				model.Tuser = ( string)dr["tuser"];
			if (dcc.Contains("tel")&&!(dr["tel"] is System.DBNull))  
				model.Tel = ( string)dr["tel"];
			if (dcc.Contains("fax")&&!(dr["fax"] is System.DBNull))  
				model.Fax = ( string)dr["fax"];
			if (dcc.Contains("predate")&&!(dr["predate"] is System.DBNull))  
				model.Predate = ( int)dr["predate"];
			if (dcc.Contains("bsendate")&&!(dr["bsendate"] is System.DBNull))  
				model.Bsendate = ( DateTime)dr["bsendate"];
			if (dcc.Contains("stocode")&&!(dr["stocode"] is System.DBNull))  
				model.Stocode = ( int)dr["stocode"];
			if (dcc.Contains("nvarchar(20)")&&!(dr["nvarchar(20)"] is System.DBNull))  
				model.Nvarchar20 = ( string)dr["nvarchar(20)"];
			if (dcc.Contains("stuser")&&!(dr["stuser"] is System.DBNull))  
				model.Stuser = ( string)dr["stuser"];
			if (dcc.Contains("stel")&&!(dr["stel"] is System.DBNull))  
				model.Stel = ( string)dr["stel"];
			if (dcc.Contains("sfax")&&!(dr["sfax"] is System.DBNull))  
				model.Sfax = ( string)dr["sfax"];
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( int)dr["status"];
			if (dcc.Contains("ordamt")&&!(dr["ordamt"] is System.DBNull))  
				model.Ordamt = Convert.ToDouble(dr["ordamt"]);
			if (dcc.Contains("accamt")&&!(dr["accamt"] is System.DBNull))  
				model.Accamt = Convert.ToDouble(dr["accamt"]);
			if (dcc.Contains("gainamt")&&!(dr["gainamt"] is System.DBNull))  
				model.Gainamt = Convert.ToDouble(dr["gainamt"]);
			if (dcc.Contains("gainpct")&&!(dr["gainpct"] is System.DBNull))  
				model.Gainpct = Convert.ToDouble(dr["gainpct"]);
			if (dcc.Contains("dutyamt")&&!(dr["dutyamt"] is System.DBNull))  
				model.Dutyamt = Convert.ToDouble(dr["dutyamt"]);
			if (dcc.Contains("audstatus")&&!(dr["audstatus"] is System.DBNull))  
				model.Audstatus = ( int)dr["audstatus"];
			if (dcc.Contains("agio1")&&!(dr["agio1"] is System.DBNull))  
				model.Agio1 = Convert.ToDouble(dr["agio1"]);
			if (dcc.Contains("agio2")&&!(dr["agio2"] is System.DBNull))  
				model.Agio2 = Convert.ToDouble(dr["agio2"]);
			if (dcc.Contains("agio3")&&!(dr["agio3"] is System.DBNull))  
				model.Agio3 = Convert.ToDouble(dr["agio3"]);
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
